package com.touchfired.common.constants;

import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @Description 游戏规则实体
 * @Author 幸佳俊
 */
@Data
@Accessors(chain = true)
public class GameRule {

    /** 玩家总数量（playerNum = spyerNum + normalNum） */
    private Integer playerNum;

    /** 卧底数量 */
    private Integer spyerNum;

    /** 平民数量 */
    private Integer normalNum;

    public GameRule(Integer playerNum, Integer spyerNum) {
        this.playerNum = playerNum;
        this.spyerNum = spyerNum;
        this.normalNum = playerNum - spyerNum;
    }

    /**
     * 获取规则提示
     * @return 规则字符串
     */
    public String getRulesAppend() {
        return "[规则]：平民："+ normalNum +"，卧底：" + spyerNum + "（平民剩1人或卧底全阵亡）";
    }
}
